<?php 
#$CI =& get_instance();
#$CI->load->library("front/header_lib");
#$CI->header_lib->display_header_element(array("script"=>array("jquery")));
#$CI->header_lib->display_header();
?>
<?php $this->load->view(TEMPLATE_NAME.'/front/boxes/header_view'); ?>
<?php $this->load->view(TEMPLATE_NAME.'/front/side_left'); ?>
<script>
$(document).ready(function(){
    $('#search').each(function() {
        var default_value = this.value;
        $(this).focus(function() {
            if(this.value == default_value) {
                this.value = '';
            }
        });
        $(this).blur(function() {
            if(this.value == '') {
                this.value = default_value;
            }
        });
    });
});
</script>
<style type="text/css" title="text/css"> 
/* == Pagination === */
ul{border:0; margin:0; padding:0;}

#pagination-digg {
    text-align:center;
    list-style:none;
    margin-bottom:20px;
}
#pagination-digg li{
    border:0; margin:0; padding:0;
    font-size:11px;
    margin-right:2px;
    display:-moz-inline-stack;
    display:inline-block;
    zoom:1;
    display:inline;
} 
#pagination-digg li.active {
    padding:2px 5px;
    border:1px solid #999999;  
}
#pagination-digg li a {
    border:1px solid #999999;
    color:#666666;
    font-size:11px;
    padding:2px 5px;
}
#pagination-digg li.next a, #pagination-digg li.prev a{
    border:0 none;
    color:#990066;
    float:left;
    font-size:15px;
    font-weight:bold;
    margin-top:-4px;
}
#pagination-digg li.next {
    float:right;
}
#pagination-digg li.prev {
    float:left;
}
#pagination-digg li a:hover, #pagination-digg li.active, #pagination-digg li.next a:hover, #pagination-digg li.prev a:hover {
    background-color:#990066;
    color:#FFFFFF;
    text-decoration:none;
}

.featured-image {
    background:none repeat scroll 0 0 #FFFFFF;
    display:table;
    height:100px;
    margin:0 0px;
    overflow:hidden;
    position:relative;
    text-align:center;
    width:150px;
}
.image-middle {
    display:table-cell;
    vertical-align:middle;
    width:100%;
}
.image-inner {
    position:relative;
    /*top:-50%;*/
    width:150px;
    height:100px;
    text-align:left;
}
.image-inner img {
    max-width:150px;
    max-height:100px;
}
</style>
<div class="page">

<p class="f15 purple">Find a Product or Service. <strong>Locate on map or use options below...</strong></p>
<hr>
<?php 
$data['current_latitude'] = $current_latitude;
$data['current_longitude'] = $current_longitude;
$data['current_zoom'] = $current_zoom;
?>
<?php $this->load->view(TEMPLATE_NAME.'/js/gmap_security_directory',$data); ?>
<style type="text/css">
.crime {
    clear:both;
    float:right;
}
.crime li {
    display:inline-block;
    float:left;
    margin:0;
    vertical-align:top;
}
.sub-crime {
    float:left;
    margin:0 7px 0 0;
    width:189px;
}
.sub-crime li.sub-title {
    background:none repeat scroll 0 0 transparent;
    border-bottom:1px solid #000000;
    margin-top:20px;
    padding-bottom:5px;
}
.sub-crime li {
    background:none repeat scroll 0 0 #EBE9E1;
    display:block;
    float:none;
    line-height:normal;
    margin:3px 0 0;
    padding:3px 5px 3px 25px;
    position:relative;
}
.sub-crime li input[type="checkbox"] {
    left:3px;
    position:absolute;
    /*top:5px;*/
}

table.list { margin-bottom:15px }
.list th {
    border:1px solid #000;
    border-width:1px 0;
    color:#900;
    font-size:12px;
    padding:5px 0;
    text-align:left
}
.list td {
    border-bottom:1px solid #ccc;
    font-size:11px;
    padding:5px 0
}
.list tr:hover { background:#FAF9F7 }
.list tr.head:hover { background:none }

/*display message hover marker*/ 
#map_message {
    display: none;
    position: absolute;
    width: 12em;
    padding: .5em;
    background: #555;
    font-size: .9em;
    color: #FFF;    
}
#map_message img {
    border: 0;
    margin-top: 0;
}
#map_message a {
    color: #CAEAF9;
    border-bottom: 1px solid #EBEBEB;
}
#map_message a:hover {
    color: #FFF;
    border-bottom: 1px solid #CAEAF9;
}

#map_message #titlemessage{
    font-weight:bolder;
    background:#FFFFFF;
    color:#FF0000;
}
</style>
<div id="map" style="width:592px;height:330px;">
</div>
<hr />
<div class="drnew">
<?php
//$CI = get_instance();
//$CI->load->model(array('Location_model','Directory_services_model'));
//$product_list = $CI->Directory_services_model->get_list_services();
//$services_list = $CI->Directory_services_model->get_list_services("services");
//$brands_list = $CI->Directory_services_model->get_list_services("brands");
//$region_list = $CI->Location_model->get_region_by_country(224);
//echo "<pre><font color='#999999'>";print_r($product_list);echo "</font></pre>";
//$crime_type_list =$CI->Crime_type_model->get_complete_crime_type();
echo form_open('directory'); ?>
<label>Product/Service: <sup>*</sup></label> 
<select class="long" name="services"><option value="">Select Product or Service</option>
<option value="">--------------------------------------</option>
<option value="all_products" <?php if($services == "all_products"){?> selected="selected" <?php } ?>>ALL PRODUCTS</option>
<?php foreach($product_list as $products){  ?>
<option value="<?php echo $products['id'];?>" <?php if($services == $products['id']){?> selected="selected" <?php } ?>><?php echo $products['name']; ?></option>
<?php } ?>
<option value="">--------------------------------------</option>
<option value="all_services" <?php if($services == "all_services"){?> selected="selected" <?php } ?>>ALL SERVICES</option>
<?php foreach($services_list as $service){  ?>
<option value="<?php echo $service['id']; ?>" <?php if($services == $service['id']){?> selected="selected" <?php } ?>><?php echo $service['name']; ?></option>
<?php } ?>
<option value="">--------------------------------------</option>
<option value="all_brands" <?php if($services == "all_brands"){?> selected="selected" <?php } ?>>ALL BRANDS</option>
<?php foreach($brands_list as $brands){  ?>
<option value="<?php echo $brands['id']; ?>" <?php if($services == $brands['id']){?> selected="selected" <?php } ?>><?php echo $brands['name']; ?></option>
<?php } ?>
</select> 
<hr>
 
<label>Province: <sup>*</sup></label> 
<select name="province" class="dir_select">
<option value="">All Provinces</option>
<?php if(!empty($region_list)): ?>
<?php foreach($region_list as $key=>$value): ?>
<option value="<?php echo $value['id']?>" <?php if($province == $value['id']){?> selected="selected" <?php }?>><?php echo $value['name'] ?></option>
<?php endforeach;?>
<?php endif; ?>
</select>
<?php 
$form_button = array(
  'name'=>'submit',
  //'id'=>'sys_search',
  'type'=>'submit',
  'value'=>'submit',
  'content'=>'Submit',
);
echo form_button($form_button);
echo form_close(); ?>
<hr>
<?php echo form_open('directory')?>
<label>Search Directory:</label> 
<input id="search" class="dir_searchtxt" name="search" type="text" value="<?php if(!empty($search)){echo $search;}else{ echo "Search...";}?>"> 
<?php 
$form_button = array(
  'name'=>'submit',
  //'id'=>'sys_search',
  'type'=>'submit',
  'value'=>'search',
  'content'=>'&nbsp;',
  'class'=>'dir_go_btn'
);
echo form_button($form_button);
echo form_close();?>
<hr></div><!-- drnew -->
<p class="f15 purple">(<?php echo $total_company;?>) results found for your selection above - <strong>see results below</strong></p>
<hr>
<?php if(!empty($pagination)){?>
<ul id="pagination-digg"> 
    <?php echo $pagination ?>
</ul>
<hr>
<?php } ?>
<?php if(!empty($company_list)){ 
 $this->load->helper('path');
 $pathvar = set_realpath('',TRUE).'uploads/directory/company_logo/thumb/';
       
foreach($company_list as $key=>$value){ 
   if(file_exists($pathvar.$value['company_logo'])){
   ?>
<div class="img">
    <div class="featured-image">
        <div class="image-middle">
	    <div class="image-inner"><a href="<?php echo site_url($value['company_slug_name'].$url); ?>">
                <img src="<?php echo $logo_thumbnail_folder.$value['company_logo'] ?>" />
		</a>
            </div>
        </div>
    </div>
</div>
<?php
}
?>
<strong class="f18 norm"><a href="<?php echo site_url(''.$value['company_slug_name'].$url); ?>"><?php echo $value['company'] ?></a></strong>
<p><strong class="purple">&gt;</strong> <?php echo $value['city_name'] ?>, <?php echo $value['province_name'] ?></p>
<div class="clear"></div>
<hr>
  <?php } ?>
<?php } ?>
<?php if(!empty($pagination)){?>
<ul id="pagination-digg"> 
    <?php echo $pagination ?>
</ul>
<hr>
<?php } ?>
<p class="f15 purple"><strong>Want to advertise in this directory?</strong> <a href="<?php echo site_url('advertise'); ?>">Please click here to find out how.</a></p>
<hr>
<?php $this->load->view(TEMPLATE_NAME.'/front/footer_menu'); ?>
</div>
<?php $this->load->view(TEMPLATE_NAME.'/front/side_right'); ?>
<?php $this->load->view(TEMPLATE_NAME.'/front/footer'); ?>
<?php
#$CI->load->library("front/footer_lib");
#$CI->footer_lib->display_footer();
#$CI->footer_lib->display_footer_element();

?>

